<link href="__CDN__/assets/addons/kuerp/css/common.css?v={$Think.config.site.version}" rel="stylesheet">
<link rel="stylesheet" href="__CDN__/assets/addons/kuerp/layui/css/layui.css"  media="all">
<style type="text/css">
    .btn-list {
        position: fixed;
        right: 40px;
    }
    .div-flex {
        display: flex
    }
    .div-flex .form-group {
        margin-right: 50px;
        text-align: center;
        line-height: 25px;
        margin-bottom: 0;
    }
    .tab-pane {
        border: 1px solid #F6F6F6;
    }
    .i-color {
        font-size: 34px;margin-right: 10px;color: #86C3FF;
    }
    .thumbnail {
        display: flow-root;
        width: max-content;
    }
    .thumbnail img {
        width: 50px;
        float: left;
        padding: 5px;
    }
    .text-color{
        color:#777;
    }
    .examine_title{
        font-size: 14px;
        color: #333;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
        display: block;
        height: 30px;
    }
    .examine_box{
        padding-left:20px;
        position: relative;
    }
    .examine_box .newicon{
        position: absolute;
        left:0;
        top:0;
        z-index: 2;
    }
    .examine_box .xian{
        width:1px;
        height:100%;
        background:#e6e6e6;
        position: absolute;
        left:4px;
        top:10px;
        z-index: 1;
    }
    .examine_box .examine_bg{
        position: relative;
        margin-top: 15px;
        border-radius: 4px;
        background-color: #f7f8fa;
        font-size: 12px;
        color: #929293;
        padding: 8px;
        line-height: 18px;
    }
    .rowbox{
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }
    .user-image{
        width: 40px;
        height: 40px;
        border-radius: 50%;

    }
    .stafflist {
        display: flex;
        justify-content: flex-start;
		align-items: center;
        border-bottom:1px solid #f5f5f5;
        margin-bottom: 10px;
    }
    .staffli {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-right:12px;
        margin-bottom:12px;
        flex-shrink: 0;
    }
    .staffimg{
        width:30px;
        height:30px;
        border-radius: 50%;
        margin-bottom:5px;
    }
    .staffname{
        font-size:14px;
        color:#999;
    }
    .staffcon {
        margin-left:12px;
    }
    .approval_status{
        font-size:12px;
        color:#333;
        margin-bottom:7px;
    }
</style>
<div class="panel panel-default panel-intro">
    <input type="hidden" name="ids" id="ids" value="{$ids}"/>
    <div class="div-flex">
        <i class="fa fa-address-card i-color"></i>
        <div style="line-height: 35px"><b>{$row.apply_code}</b></div>
    </div>

    
    </div>
    <div class="div-flex" style="margin-top: 20px">
        <div class="form-group">
            <span class="text-muted">申请编号</span>
            <p>{$row.apply_code}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">关联订单</span>
            <p><a href='javascript:void(0);' style='color: #4397fd' class='btn-dialog'
                data-url='kuerp/goods_sales/detail/ids/{$row.goodssales_id}' data-title='订单详情' data-area='["100%","80%"]' >{$row.goodssales_code}</a></p>
        </div>
        <div class="form-group">
            <span class="text-muted">关联客户</span>
            <p><a href='javascript:void(0);' style='color: #4397fd' class='btn-dialog'
                data-url='kuerp/customers/detail/ids/{$row.customer.id}' data-title='客户详情' data-area='["100%","80%"]' >{$row.customer.customer_name}</a></p>
        </div>
        <div class="form-group">
            <span class="text-muted">申请人</span>
            <p>{if condition="isset($row.admin.nickname)"}{$row.admin.nickname}{/if}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">申请总金额</span>
            <p style="color: red">{$row.total_score}</p>
        </div>
        <div class="form-group">
            <span class="text-muted">申请日期</span>
            <p>{$row.createtime_text} </p>
        </div>
        {if !$can_examine }
        <div class="form-group">
            <span class="text-muted">赠送状态</span>
            <p>{$row.pay_status == 1 ? '已赠送' : '未赠送'}</p>
        </div>
        {/if}
    </div>
    <div>
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation"  class="active"><a href="#product" aria-controls="profile" role="tab" data-toggle="tab">申请明细</a></li>
            <!-- <li role="presentation"><a href="#settings4" aria-controls="settings" role="tab" data-toggle="tab">相关附件</a></li> -->
        </ul>

        <div class="tab-content" style="overflow-y: scroll;height:350px">
            <div role="tabpanel" class="tab-pane fade in active panel-body" id="product">
                {if $can_examine && $is_last_step}
                <form id="examine-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
                    <table class="table table-striped table-bordered table-hover table-nowrap" width="100%">
                        <thead>
                            <tr>
                                <th>手机号</th>
                                <th>积分</th>
                                <th>备注</th>
                                <th>加赠积分</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach name="apply_data" item="vo" key="k"}
                            <tr>
                                <td>{$vo.mobile} <input class="form-control" name="apply_data[{$k}][mobile]" type="hidden" value="{$vo.mobile}"></td>
                                <td>{$vo.score} <input class="form-control" name="apply_data[{$k}][score]" type="hidden" value="{$vo.score}"></td>
                                <td>{$vo.remark} <input class="form-control" name="apply_data[{$k}][remark]" type="hidden" value="{$vo.remark}"></td>
                                <td><input class="form-control" name="apply_data[{$k}][addscore]" type="number" min="0" value="0"></td>
                            </tr>
                            {/foreach}
                        </tbody>
                    </table>
                </form>
                {else }
                <table class="table table-striped table-bordered table-hover table-nowrap" width="100%">
                    <thead>
                        <tr>
                            <th>手机号</th>
                            <th>积分</th>
                            <th>备注</th>
                            <th>加赠积分</th>
                        </tr>
                    </thead>
                    <tbody>
                        {foreach name="apply_data" item="vo" key="k"}
                        <tr>
                            <td>{$vo.mobile}</td>
                            <td>{$vo.score}</td>
                            <td>{$vo.addscore ?? 0}</td>
                        </tr>
                        {/foreach}
                    </tbody>
                </table>
                {/if}
            </div>
        </div>
    </div>
    <div class="row" style="margin-top: 10px">
        <div class="col-xs-12">
            <div class="form-group">
                <label class="control-label col-xs-12 col-sm-1">审批流程:</label>
                <div class="col-xs-12 col-sm-10">
                    <ul class="layui-timeline">
                        {foreach name="stepList" item="vo"}
                        <li class="layui-timeline-item">
                            <i class="layui-icon layui-timeline-axis"></i>
                            <div class="layui-timeline-content layui-text">
                                <div class="layui-timeline-title">{$vo.status == 1 ? '指定员工(任意一人)' : '指定员工(会签)'}</div>
                                {foreach name="vo.stafflist" item="v"}
                                <div class="stafflist">
                                    <div class="staffli">
                                        <img src="{$v.img}" class="staffimg" mode=""/>
                                        <div class="staffname">{$v.name}</div>
                                    </div>
                                    <div class="staffcon">
                                        <div class="approval_status">{$v.examine_reord.check_time? $v.examine_reord.check_time:''}</div>
                                        <div class="approval_status">
                                            {if condition="$v.examine_reord.status == 1"}
                                            <i class='fa fa-check-circle text-success newicon'></i>
                                            {elseif condition="$v.examine_reord.status == 0 && $v.examine_reord.check_time != ''"}
                                            <i class='fa fa-window-close text-red newicon'></i>
                                            {/if}
                                            {$v.examine_reord.status_text? $v.examine_reord.status_text:''}
                                        </div>
                                        <div class="approval_status">{$v.examine_reord.content?$v.examine_reord.content:''}</div>
                                    </div>
                                </div>
                                {/foreach}
                            </div>
                        </li>
                        {/foreach}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    {if $can_examine }
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button class="btn btn-success btn-embossed examine" data-value="1">{:__('审核通过')}</button>
            <button class="btn btn-danger btn-embossed examine" data-value="0">{:__('审核拒绝')}</button>
        </div>
    </div>
    {/if}
</div>